<%@ page language="java" contentType="text/html; charset=utf-8"
    pageEncoding="utf-8"%>
 <%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<link rel="stylesheet" href="<c:url value='/css/common.css'></c:url>">
<script type="text/javascript" src="<c:url value='/js/jquery-1.6.js'/>" ></script>
<script type="text/javascript" src="<c:url value='/js/form.js'/>" > </script>
<script type="text/javascript">
validate=false;
function check(inputt,min,max,error)
{
		if(inputt.val().length<min||inputt.val().length>max)
		{
			$(inputt).next("label").html(error+min+"-"+max+"位");
			return false;
		}
		else
			{
			$(inputt).next("label").html("");
			return true;
			}
}
function val()
{	validate=true;
	validate=validate&&check($("input[name=username]"),"2","5","用户名长度只能为");
	validate=validate&&checkRg($("input[name=password]"),rgpassword,"密码格式不对，字母开头9,19位");
}
$(function(){
	$('input[type=button]').click(function(){
		val();
		if(validate)
			{
			 $('#f').submit();
			}
	});
	$('div').css("text-align","left");
	
});
</script>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>Insert title here</title>
</head>
<body>
	<h4>${tip}</h4>
	<form id="f" action="<c:url value='/myspace/useradd.action' />" method="post">
		<div>用户名：&nbsp;&nbsp;<input type="text" name="username" /><label>用户名长度只能为2-5位</label></div>
		<div>密码：&nbsp;&nbsp;&nbsp;&nbsp;<input type="password" name="password" /><label>以字母开头，9到19位</label>
					</div>
		<div><input value="添加" type="button">
		</div>
	</form>
	
</body>
</html>